package com.qk.management.mapper;

import com.qk.entity.Dept;
import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RoleMapper {




    @Select("select * from role where id = #{roleId}")
    Role selectByroleId(Integer roleId);





//    -------
    Integer count(@Param("name") String name,
                  @Param("label") String label);

    List<Role> selectByPage(
            @Param("name") String name,
            @Param("label") String label,
            @Param("offset") Integer offset,
            @Param("pageSize") Integer pageSize);

    @Insert("insert into role(name,label,remark,create_time,update_time) values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role  role);

    @Select("SELECT id, name, label,remark, create_time , update_time FROM role WHERE id = #{id}")
    Role selectById(Integer id);

    void updateRole (Role role);

    @Delete("DELETE FROM role WHERE id = #{id}")
    void deleteById(Integer id);

    @Select("select * from role")
    List<Role> selectAll();
}
